var assert = require('assert');
var should = require('should');
var _ = require('lodash');
var marketModel = require('../../app/models/marketModel');
var config = require('../config');

suite('marketModel', function () {
    setup(function (done) {
        marketModel.getByRoleId(config.role_id, function (err, model) {
            assert.equal(err == null, true);
            model.toJSON();
            model.save(done);
        });
    });

    suite('market', function () {
        test('获取玩家市场信息', function (done) {
            marketModel.getByRoleId(config.role_id, function (err, market_model) {
                assert.equal(err == null, true);
                market_model.randMarketList();
                market_model.market_list.length.should.equal(5);
                market_model.save();

                done();
            });
        });
    });
});
